Logo
Spacer News Wiki Features F.A.Q. Team members Screenshots Download Messageboard Bug tracker Submit files
Top divider

Lua FeatureDefs

The FeatureDefs[] table holds all information about the features used in a mod. Note: Its entries are metatables, so you can't use the pairs() iterator on them, use this instead:

 for id,featureDef in pairs(FeatureDefs) do
   for name,param in featureDef:pairs() do
     Spring.Echo(name,param)
   end
 end

Here is an example of a FeatureDef:

 FeatureDefs[3]["blocking"] = false,
 FeatureDefs[3]["burnable"] = false,
 FeatureDefs[3]["deathFeature"] = "",
 FeatureDefs[3]["destructable"] = false,
 FeatureDefs[3]["drawType"] = 0,
 FeatureDefs[3]["drawTypeString"] = "3do",
 FeatureDefs[3]["energy"] = 0,
 FeatureDefs[3]["filename"] = "features/corpses/type1.tdf",
 FeatureDefs[3]["floating"] = false,
 FeatureDefs[3]["geoThermal"] = false,
 FeatureDefs[3]["height"] = 3.9283447265625,
 FeatureDefs[3]["hitSphereOffsetX"] = 0,
 FeatureDefs[3]["hitSphereOffsetY"] = 0,
 FeatureDefs[3]["hitSphereOffsetZ"] = 0,
 FeatureDefs[3]["hitSphereScale"] = 1,
 FeatureDefs[3]["id"] = 3,
 FeatureDefs[3]["mass"] = 66.900001525879,
 FeatureDefs[3]["maxHealth"] = 397,
 FeatureDefs[3]["maxx"] = 24,
 FeatureDefs[3]["maxy"] = 3.9283447265625,
 FeatureDefs[3]["maxz"] = 24,
 FeatureDefs[3]["metal"] = 68,
 FeatureDefs[3]["midx"] = 0,
 FeatureDefs[3]["midy"] = 1.9383087158203,
 FeatureDefs[3]["midz"] = 0,
 FeatureDefs[3]["minx"] = -24,
 FeatureDefs[3]["miny"] = -0.051727294921875,
 FeatureDefs[3]["minz"] = -24.318237304688,
 FeatureDefs[3]["modelType"] = 0,
 FeatureDefs[3]["modelname"] = "objects3d/3X3D",
 FeatureDefs[3]["name"] = "ahermes_heap",
 FeatureDefs[3]["noSelect"] = false,
 FeatureDefs[3]["radius"] = 27.287155151367,
 FeatureDefs[3]["reclaimable"] = true,
 FeatureDefs[3]["reclaimTime"] = 23213,
 FeatureDefs[3]["tooltip"] = "Wreckage",
 FeatureDefs[3]["upright"] = false,
 FeatureDefs[3]["useHitSphereOffset"] = false,
 FeatureDefs[3]["xsize"] = 6,
 FeatureDefs[3]["ysize"] = 6,

Retrieved from "http://spring.clan-sy.com/wiki/Lua_FeatureDefs"

This page has been accessed 253 times. This page was last modified 17:43, 18 January 2008.